package avicit.bdp.dds.dao.entity;

import avicit.bdp.common.base.BaseDTO;
import avicit.platform6.core.annotation.log.FieldRemark;
import avicit.platform6.core.annotation.log.Id;
import avicit.platform6.core.annotation.log.LogField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import javax.persistence.Column;
import javax.persistence.Table;
import javax.persistence.Transient;

@ApiModel(value = "ProjectUser", description = "bdp_dds_r_project_user")
@Table(name = "bdp_dds_r_project_user")
public class ProjectUser extends BaseDTO {
    /**
     * id
     */
    @Id
    @LogField
    @ApiModelProperty(value = "id", name = "id")
    @FieldRemark(column = "id", field = "id", name = "id")
    @javax.persistence.Id
    @Column(name = "id")
    private String id;

    @LogField
    @ApiModelProperty(value = "项目id", name = "projectId")
    @FieldRemark(column = "project_id", field = "projectId", name = "项目id")
    @Column(name = "project_id")
    private String projectId;

    @LogField
    @ApiModelProperty(value = "用户id", name = "userId")
    @FieldRemark(column = "user_id", field = "userId", name = "用户id")
    @Column(name = "user_id")
    private String userId;

    @LogField
    @ApiModelProperty(value = "权限", name = "perm")
    @FieldRemark(column = "perm", field = "perm", name = "权限")
    @Column(name = "perm")
    private Integer perm;


    /**
     * project name
     */
    @Transient
    private String projectName;

    /**
     * user name
     */
    @Transient
    private String userName;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getProjectId() {
        return projectId;
    }

    public void setProjectId(String projectId) {
        this.projectId = projectId;
    }

    public String getProjectName() {
        return projectName;
    }

    public void setProjectName(String projectName) {
        this.projectName = projectName;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }


    public Integer getPerm() {
        return perm;
    }

    public void setPerm(Integer perm) {
        this.perm = perm;
    }

    @Override
    public String toString() {
        return "ProjectUser{" +
                "id=" + id +
                ", projectId=" + projectId +
                ", userId=" + userId +
                ", projectName='" + projectName + '\'' +
                ", userName='" + userName + '\'' +
                '}';
    }
}
